package com.hai.test.ui.base;

import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.os.StrictMode;
import android.util.Log;
import android.view.Choreographer;

import java.util.ArrayList;
import java.util.List;

/**
 * fileDesc
 * Created by huanghp on 2018/12/21.
 * Email h1132760021@sina.com
 */
public class MyApplication extends Application {
    private static final String TAG = "MyApplication";
    long lastTime = 0;

    @Override
    public void onCreate() {
        super.onCreate();
       /* if (LeakCanary.isInAnalyzerProcess(this)) {
            // This process is dedicated to LeakCanary for heap analysis.
            // You should not init your app in this process.
            return;
        }
        LeakCanary.install(this);*/
//        Debug.startMethodTracing();
        Choreographer.getInstance().postFrameCallback(new Choreographer.FrameCallback() {
            @Override
            public void doFrame(long frameTimeNanos) {
                if (lastTime != 0) {
                    long interval = (frameTimeNanos - lastTime) / 1000000;
                }
                lastTime = frameTimeNanos;
                Choreographer.getInstance().postFrameCallback(this);
            }
        });
    }
}
